#!
$TermsFileName = ".\\files\\terms.txt";
$ResultFileName = ".\\files\\result.txt";

open(TERMS,$TermsFileName)||die "Can not open $TermsFileName: $_\n";
open(RESULT,">$ResultFileName")||die "Can not open $ResultFileName: $_\n";

@Terms = <TERMS>;
# find all terms that begin with a and end with s.
@a = grep /^a([a-z]*)s$/i, @Terms;
print RESULT @a;

close TERMS;
close RESULT;
